package com.systop.common.modules.region.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.systop.core.model.BaseModel;

@Entity
@Table(name = "region")
@SuppressWarnings("serial")
public class Region extends BaseModel {

	/** 主键 */
	protected Integer id;

	/** 地区名称 */
	protected String regionName;

	/** 地区类型 */
	protected Short regionType;

	/** 上级 */
	protected Integer parentId;

	@Id
	@GeneratedValue(generator = "hibseq")
	@GenericGenerator(name = "hibseq", strategy = "hilo")
	@Column(name = "id", nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getRegionName() {
		return regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	/**
	 * 地区类型 1=省份 2=市
	 * 
	 * @return
	 */
	public Short getRegionType() {
		return regionType;
	}

	public void setRegionType(Short regionType) {
		this.regionType = regionType;
	}

	public Integer getParentId() {
		return parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}
}
